package com.ourchem.web.controller.bus;


import com.ourchem.bus.service.NacosDataTokenService;
import com.ourchem.common.core.domain.AjaxResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

@RestController
@RequestMapping("/bus/productDataBase")
public class ProductDataBase {


    @Autowired
    NacosDataTokenService nacosDataTokenService;

    /**
     * 拿这这个token就可以访问专题库了
     * @return
     */
    @GetMapping("/productDataBase")
    public AjaxResult getToken(){
        String token = nacosDataTokenService.getToken();
        String refreshToken = nacosDataTokenService.getRefreshToken();
        Map map = new HashMap<>();
        map.put("access_token",token);
        map.put("refresh_token",refreshToken);
        return AjaxResult.success(map);

    }


}
